import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user.js'
import settings from './modules/settings'
import app from './modules/app'
import tagsView from './modules/tagsView'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {},
  getters: {
    token: state => state.user.token,
    avatar: state => state.user.avatar,
    name: state => state.user.name,
    sidebar: state => state.app.sidebar,
    device: state => state.app.device,
    visitedViews: state => state.tagsView.visitedViews,
    cachedViews: state => state.tagsView.cachedViews
  },
  mutations: {},
  actions: {},
  modules: {
    user,
    settings,
    app,
    tagsView
  }
})